FROM centos:7.8.2003

MAINTAINER 397824870@qq.com

COPY mysql-community-common-5.7.31-1.el7.x86_64.rpm /root/mysql-community-common-5.7.31-1.el7.x86_64.rpm
COPY mysql-community-libs-compat-5.7.31-1.el7.x86_64.rpm /root/mysql-community-libs-compat-5.7.31-1.el7.x86_64.rpm
COPY mysql-community-client-5.7.31-1.el7.x86_64.rpm  /root/mysql-community-client-5.7.31-1.el7.x86_64.rpm
COPY mysql-community-libs-5.7.31-1.el7.x86_64.rpm  /root/mysql-community-libs-5.7.31-1.el7.x86_64.rpm
COPY mysql-community-server-5.7.31-1.el7.x86_64.rpm  /root/mysql-community-server-5.7.31-1.el7.x86_64.rpm
COPY postfix-2.10.1-9.el7.x86_64.rpm  /root/postfix-2.10.1-9.el7.x86_64.rpm

WORKDIR /root
RUN yum remove mysql-libs -y
RUN yum -y install *.rpm

ADD initialization.sql /root/initialization.sql
ADD my.cnf /etc/my.cnf
ADD setup.sh /root/setup.sh

RUN yum clean all
RUN chmod +x /root/setup.sh

EXPOSE 3306

CMD ["/root/setup.sh"]
